#ifndef TABLE_H_
#define TABLE_H_

#include <iostream>
#include <vector>
#include <string>
#include <iomanip>

class Record{
    public:
        Record();
        Record(int index);
        ~Record();

        virtual void Show();

        void IncIndex();

        void DecIndex();
    protected:
        int index_;
};

class Student : public Record{
    public:
        Student();

        Student(int index);

        Student(int index, std::string name, int id, double score);

        ~Student();

    public:

        void SetName(std::string name);

        void SetId(int id);

        void SetScore(double score);

        int GetId();

        std::string GetName();

        double GetScore();

        void Show();

    private:
        std::string name_;
        int id_;
        int score_;
};

class Table : public Record{
    public :

        Table();
    
        ~Table();
    public :

        bool NewStu();

        void Show();

        void ShowHeader();

        void ShowLine(int index);

        bool AddStu(Student& stu);

        bool MoveStu(int index);

        Student FindStu(int index);

        bool ModifyStu(int index, Student& target);

    private:

        std::vector<Student> students_;

        Student stu_last;

        int last = 0;

};

#endif